package com.example.sys

import com.example.lib_common.mvi.BaseRepository
import com.example.lib_common.mvi.ResponseEntity
import com.zyj.retrofit.adapter.FlowCallAdapterFactory
import kotlinx.coroutines.flow.Flow
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory

class MainRepository : BaseRepository(){
    fun requestHot() : Flow<ResponseEntity<HomeFeedEntity>>{
        var builder :Retrofit.Builder= Retrofit.Builder()
        builder.baseUrl("http://118.195.161.134:8088/serverdemo/")
        builder.addConverterFactory(GsonConverterFactory.create())
        builder.addCallAdapterFactory(FlowCallAdapterFactory.create())
        var retrofit = builder.build()
        return retrofit.create(ApiService::class.java)
            .requestHot()
    }
}